-- GENERATED SPELL FOR [Moodle] --


function spell0_28122(pUnit, Event) --@Dispersal,Self--
pUnit:FullCastSpellOnTarget(52972,pUnit)
pUnit:RegisterEvent('Sorts_28122', 4344, 1)
end

function spell1_28122(pUnit, Event) --@Frost Breath,Self--
pUnit:FullCastSpellOnTarget(52973,pUnit)
pUnit:RegisterEvent('Sorts_28122', 6500, 1)
end

function spell2_28122(pUnit, Event) --@Vicious Roar,Self--
pUnit:FullCastSpellOnTarget(52974,pUnit)
pUnit:RegisterEvent('Sorts_28122', 15279, 1)
end

function spell3_28122(pUnit, Event) --@Whirlwind,Self--
pUnit:FullCastSpellOnTarget(52977,pUnit)
pUnit:RegisterEvent('Sorts_28122', 627, 1)
end

function Sorts_28122(pUnit, Event)
local choix_sorts_28122 = math.random(0, 3)
if choix_sorts_28122 == 0 then
pUnit:RegisterEvent('spell0_28122', 1, 1)
end
if choix_sorts_28122 == 1 then
pUnit:RegisterEvent('spell1_28122', 1, 1)
end
if choix_sorts_28122 == 2 then
pUnit:RegisterEvent('spell2_28122', 1, 1)
end
if choix_sorts_28122 == 3 then
pUnit:RegisterEvent('spell3_28122', 1, 1)
end
end

function mob28122_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_28122', math.random(1500, 3000), 1)
end

function mob28122_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob28122_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob28122_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(28122, 1, 'mob28122_Action')
RegisterUnitEvent(28122, 2, 'mob28122_Leave')
RegisterUnitEvent(28122, 3, 'mob28122_Kill')
RegisterUnitEvent(28122, 4, 'mob28122_Die')
